﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FourPartHarmony3 {
    class Constants {
        /// <summary>
        /// 譜の上端Y
        /// </summary>
        public const double STAFF_OFFSET_Y = 0;

        /// <summary>
        /// ト音記号のF線のY座標
        /// </summary>
        public const double LINE_G_TOP = 80.0 / 2;
        public const double LINE_TO_LINE_PIXEL = 16.0 / 2;
        public const double LINE_G_BOTTOM = LINE_G_TOP + LINE_TO_LINE_PIXEL * 4;

        /// <summary>
        /// ト音記号のC4のY座標。
        /// </summary>
        public const double G_O4C_Y_PIXEL = LINE_G_TOP + LINE_TO_LINE_PIXEL * 5.0;

        public const double LINE_LEFT = 50.0 / 2;
        public const double LINE_LENGTH = 16384.0;
        public const double GCLEF_OFFSET_X = 30.0 / 2;
        public const double FCLEF_OFFSET_X = 13.0 / 2;

        /// <summary>
        /// 2度～3度音程で臨時記号が重なるとき一方の臨時記号をずらすXオフセット量。
        /// </summary>
        public const double ACCIDENTAL_OFFSET_X = 20.0 / 2;

        /// <summary>
        /// ト音記号またはヘ音記号の右端X座標。
        /// </summary>
        public const double STAFF_OFFSET_X = (LINE_LEFT + 120.0) / 2;

        /// <summary>
        /// 調号のシャープやフラットの幅
        /// </summary>
        public const double KEY_SYMBOL_WIDTH = 18 / 2;

        /// <summary>
        /// 和音の幅の半分。
        /// </summary>
        public const double CHORD_WIDTH_HALF_X = 100.0 / 2;

        /// <summary>
        /// 和音一覧の和音とセパレーター小節線までの距離
        /// </summary>
        public const double CHORD_END_TO_SEPARATOR_X = CHORD_WIDTH_HALF_X;

        /// ト音記号のF線からヘ音記号の5線のA線までの線の数。
        public const double F_INTERVAL_LINES = 12.0;

        /// <summary>
        /// ヘ音記号のA線のY座標。
        /// </summary>
        public const double LINE_F_TOP = LINE_G_TOP + F_INTERVAL_LINES * LINE_TO_LINE_PIXEL;
        public const double LINE_F_BOTTOM = LINE_F_TOP + 4 * LINE_TO_LINE_PIXEL;

        /// <summary>
        /// ヘ音記号のC3のY座標。
        /// </summary>
        public const double F_O3C_Y_PIXEL = LINE_F_TOP + LINE_TO_LINE_PIXEL * 2.5;

        /// 和音記号の位置
        public const double CHORD_SYMBOL_OFFSET_X = LINE_TO_LINE_PIXEL * 2;
        public const double CHORD_SYMBOL_OFFSET_Y = LINE_F_BOTTOM + LINE_TO_LINE_PIXEL * 3;

        /// <summary>
        /// 5線の最小長さ。
        /// </summary>
        public const double MINIMUM_SCORE_WIDTH = CHORD_WIDTH_HALF_X * 2 + CHORD_END_TO_SEPARATOR_X;

        /// <summary>
        /// 調名フォントサイズ (device independent px)
        /// </summary>
        public const double KEY_FONT_SIZE = 16;
        public const double KEY_FONT_OFFSET_X = LINE_LEFT - 30.0/2; 
        public const double KEY_FONT_OFFSET_Y = LINE_F_BOTTOM + LINE_TO_LINE_PIXEL * 2;

        /// <summary>
        /// 判定表示。
        /// </summary>
        public const double CHORD_VERDICT_OFFSET_X = CHORD_SYMBOL_OFFSET_X;
        public const double CHORD_VERDICT_OFFSET_Y = LINE_G_TOP - LINE_TO_LINE_PIXEL * 4;

        /// <summary>
        /// 終止表示。
        /// </summary>
        public const double CHORD_TERMINATION_X = CHORD_SYMBOL_OFFSET_X + LINE_TO_LINE_PIXEL*1.5;
        public const double CHORD_TERMINATION_Y = LINE_G_TOP - LINE_TO_LINE_PIXEL * 2;

        /// <summary>
        /// スコア内判定表示文字列。
        /// </summary>
        public const double CHORD_VERDICT_FONT_SIZE = 12;

        /// <summary>
        /// 和音フォーカスの上端
        /// </summary>
        public const double CHORD_FOCUS_OFFSET_Y_TOP = LINE_G_TOP - LINE_TO_LINE_PIXEL * 5;

        /// <summary>
        /// 和音フォーカスの下端
        /// </summary>
        public const double CHORD_FOCUS_OFFSET_Y_BOTTOM = LINE_F_BOTTOM + LINE_TO_LINE_PIXEL * 5;

        public const double CHORD_FOCUS_WIDTH = CHORD_WIDTH_HALF_X * 2 - LINE_TO_LINE_PIXEL/2;

        /// <summary>
        /// 和音記号の位置から内部調括弧開始までのオフセットX
        /// </summary>
        public const double INTERNAL_KEY_OFFSET_X = -LINE_TO_LINE_PIXEL * 3;

        /// <summary>
        /// 和音候補一覧のセパレーター小節線の2本の線の間隔x
        /// </summary>
        public const double DOUBLE_BAR_INTERVAL_X = 5;
    }
}
